var valueTest={
  mobile: function (val) {
    return /^1[3458]\d{9}$/.test(val);
  },
  money:function (val) {
    return /^(?:0|[1-9]\d*)(?:\.\d{1,2})?$/.test(val);
  },
  idcard:function (val) {
    var value = val, isValid = true;
    var cityCode = {11:"北京",12:"天津",13:"河北",14:"山西",15:"内蒙古",21:"辽宁",22:"吉林",23:"黑龙江 ",31:"上海",32:"江苏",33:"浙江",34:"安徽",35:"福建",36:"江西",37:"山东",41:"河南",42:"湖北 ",43:"湖南",44:"广东",45:"广西",46:"海南",50:"重庆",51:"四川",52:"贵州",53:"云南",54:"西藏 ",61:"陕西",62:"甘肃",63:"青海",64:"宁夏",65:"新疆",71:"台湾",81:"香港",82:"澳门",91:"国外 "};
    var rFormat =/^\d{6}(19|20)\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$|^\d{6}\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}$/;    // 格式验证
    if ( !rFormat.test(value) || !cityCode[value.substr(0,2)] ) {
      isValid = false;
    } else if (value.length === 18) {
      var Wi = [ 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2, 1 ];
      var Ci = "10X98765432";
      var sum = 0;
      for (var i = 0; i < 17; i++) {
        sum += value.charAt(i) * Wi[i];
      }
      var C17 = Ci.charAt(sum % 11);
      if ( C17 !== value.charAt(17) ) {
        isValid =false;
      }
    }
    return isValid;
  },
  username:function (val) {
    return /^\w+$/.test(val);
  },
  email:function (val) {
    return /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(val);
  },
  url:function (val) {
    return /^https?:\/\/(([a-zA-Z0-9_-])+(\.)?)*(:\d+)?(\/((\.)?(\?)?=?&?[a-zA-Z0-9_-](\?)?)*)*$/i.test(val);
  },
  zip:function (val) {
    return /^[1-9]\d{5}(?!\d)$/.test(val);
  }
};